﻿<?xml version="1.0" encoding="utf-8"?>

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction
    Id="Ribbon.List.BIMP.ManageNotifications"
    Location="CommandUI.Ribbon"
    RegistrationId="100"
    RegistrationType="List"
    Rights="ManageWeb"
    Title="Add a Ribbon Button">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.List.Share.AlertMe.Menu._children">
          <MenuSection Id="Ribbon.List.Share.AlertMe.BIMP" Sequence="30" DisplayMode="Menu16">
            <Controls Id="Ribbon.List.Share.AlertMe.BIMP.Controls">
              <Button Id="Ribbon.List.Share.AlertMe.BIMP.AddNewNotification"
                Command="BIMP.List.AddNewNotificationCommand"
                Sequence="40"
                Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png" Image16by16Top="-144" Image16by16Left="-224"
                Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png" Image32by32Top="-128" Image32by32Left="-64"
                Description="$Resources:BIMP, List_RibbonTabAction_AddNewNotification_Descr"
                LabelText="$Resources:BIMP, List_RibbonTabAction_AddNewNotification_Name"/>

              <Button Id="Ribbon.List.Share.AlertMe.BIMP.Manage"
                Command="BIMP.List.ManageNotificationsCommand"
                Sequence="50"
                Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png" Image16by16Top="-128" Image16by16Left="-160"
                Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png" Image32by32Top="-224" Image32by32Left="-320"
                Description="$Resources:BIMP, List_RibbonTabAction_ManageNotifications_Descr"
                LabelText="$Resources:BIMP, List_RibbonTabAction_ManageNotifications_Name"/>
            </Controls>
          </MenuSection>
        </CommandUIDefinition>
      </CommandUIDefinitions>

      <CommandUIHandlers>
        <CommandUIHandler
          Command="BIMP.List.ManageNotificationsCommand"
          CommandAction="javascript:
              function DialogCallback(dialogResult, returnValue){
              }
              
              var options = { url:&quot;http://sharepoint-2:9999/_admin/BIMP/ManageNotifications.aspx?IsDlg=1&amp;SiteUrl={SiteUrl}&amp;ListID={ListId}&quot;,
                              width: 800,
                              height: 600,
                              allowMaximize: true,
                              showClose: true,
                              dialogReturnValueCallback: DialogCallback
                            };
              SP.UI.ModalDialog.showModalDialog(options);"
          />
        <CommandUIHandler
          Command="BIMP.List.AddNewNotificationCommand"
          CommandAction="javascript:
              function DialogCallback(dialogResult, returnValue){
              }
              
              var options = { url:&quot;http://sharepoint-2:9999/_admin/BIMP/EditNotification.aspx?IsDlg=1&amp;SiteUrl={SiteUrl}&amp;ListID={ListId}&quot;,
                              width: 800,
                              height: 600,
                              allowMaximize: true,
                              showClose: true,
                              dialogReturnValueCallback: DialogCallback
                            };
              SP.UI.ModalDialog.showModalDialog(options);"
          />
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>

  <CustomAction
    Id="Ribbon.Task.BIMP.ManageNotifications"
    Location="CommandUI.Ribbon"
    RegistrationId="107"
    RegistrationType="List"
    Rights="ManageWeb"
    Title="Add a Ribbon Button">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.List.Share.AlertMe.Menu._children">
          <MenuSection Id="Ribbon.Task.Share.AlertMe.BIMP" Sequence="30" DisplayMode="Menu16">
            <Controls Id="Ribbon.Task.Share.AlertMe.BIMP.Controls">
              <Button Id="Ribbon.Task.Share.AlertMe.BIMP.AddNewNotification"
                Command="BIMP.Task.AddNewNotificationCommand"
                Sequence="40"
                Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png" Image16by16Top="-144" Image16by16Left="-224"
                Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png" Image32by32Top="-128" Image32by32Left="-64"
                Description="$Resources:BIMP, List_RibbonTabAction_AddNewNotification_Descr"
                LabelText="$Resources:BIMP, List_RibbonTabAction_AddNewNotification_Name"/>

              <Button Id="Ribbon.Task.Share.AlertMe.BIMP.Manage"
                Command="BIMP.Task.ManageNotificationsCommand"
                Sequence="50"
                Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png" Image16by16Top="-128" Image16by16Left="-160"
                Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png" Image32by32Top="-224" Image32by32Left="-320"
                Description="$Resources:BIMP, List_RibbonTabAction_ManageNotifications_Descr"
                LabelText="$Resources:BIMP, List_RibbonTabAction_ManageNotifications_Name"/>
            </Controls>
          </MenuSection>
        </CommandUIDefinition>
      </CommandUIDefinitions>

      <CommandUIHandlers>
        <CommandUIHandler
          Command="BIMP.Task.ManageNotificationsCommand"
          CommandAction="javascript:
              function DialogCallback(dialogResult, returnValue){
              }
              
              var options = { url:&quot;http://sharepoint-2:9999/_admin/BIMP/ManageNotifications.aspx?IsDlg=1&amp;SiteUrl={SiteUrl}&amp;ListID={ListId}&quot;,
                              width: 800,
                              height: 600,
                              allowMaximize: true,
                              showClose: true,
                              dialogReturnValueCallback: DialogCallback
                            };
              SP.UI.ModalDialog.showModalDialog(options);"
          />
        <CommandUIHandler
          Command="BIMP.Task.AddNewNotificationCommand"
          CommandAction="javascript:
              function DialogCallback(dialogResult, returnValue){
              }
              
              var options = { url:&quot;http://sharepoint-2:9999/_admin/BIMP/EditNotification.aspx?IsDlg=1&amp;SiteUrl={SiteUrl}&amp;ListID={ListId}&quot;,
                              width: 800,
                              height: 600,
                              allowMaximize: true,
                              showClose: true,
                              dialogReturnValueCallback: DialogCallback
                            };
              SP.UI.ModalDialog.showModalDialog(options);"
          />
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>

  <CustomAction
    Id="Ribbon.Library.BIMP.ManageNotifications"
    Location="CommandUI.Ribbon"
    RegistrationId="101"
    RegistrationType="List"
    Rights="ManageWeb"
    Title="Add a Ribbon Button">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.Library.Share.AlertMe.Menu._children">
          <MenuSection Id="Ribbon.Library.Share.AlertMe.BIMP" Sequence="30" DisplayMode="Menu16">
            <Controls Id="Ribbon.Library.Share.AlertMe.BIMP.Controls">
              <Button Id="Ribbon.Library.Share.AlertMe.BIMP.AddNewNotification"
                Command="BIMP.Library.AddNewNotificationCommand"
                Sequence="40"
                Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png" Image16by16Top="-144" Image16by16Left="-224"
                Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png" Image32by32Top="-128" Image32by32Left="-64"
                Description="$Resources:BIMP, List_RibbonTabAction_AddNewNotification_Descr"
                LabelText="$Resources:BIMP, List_RibbonTabAction_AddNewNotification_Name"/>

              <Button Id="Ribbon.Library.Library.Share.AlertMe.BIMP.Manage"
                Command="BIMP.Library.ManageNotificationsCommand"
                Sequence="50"
                Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png" Image16by16Top="-128" Image16by16Left="-160"
                Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png" Image32by32Top="-224" Image32by32Left="-320"
                Description="$Resources:BIMP, List_RibbonTabAction_ManageNotifications_Descr"
                LabelText="$Resources:BIMP, List_RibbonTabAction_ManageNotifications_Name"/>
            </Controls>
          </MenuSection>
        </CommandUIDefinition>

        <CommandUIDefinition Location="Ribbon.List.Share.AlertMe.Menu._children">
          <MenuSection Id="Ribbon.List.Share.AlertMe.BIMP" Sequence="30" DisplayMode="Menu16">
            <Controls Id="Ribbon.List.Share.AlertMe.BIMP.Controls">
              <Button Id="Ribbon.List.Share.AlertMe.BIMP.AddNewNotification"
                Command="BIMP.AddNewNotificationCommand"
                Sequence="40"
                Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png" Image16by16Top="-144" Image16by16Left="-224"
                Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png" Image32by32Top="-128" Image32by32Left="-64"
                Description="$Resources:BIMP, List_RibbonTabAction_AddNewNotification_Descr"
                LabelText="$Resources:BIMP, List_RibbonTabAction_AddNewNotification_Name"/>

              <Button Id="Ribbon.List.Share.AlertMe.BIMP.Manage"
                Command="BIMP.ManageNotificationsCommand"
                Sequence="50"
                Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png" Image16by16Top="-128" Image16by16Left="-160"
                Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png" Image32by32Top="-224" Image32by32Left="-320"
                Description="$Resources:BIMP, List_RibbonTabAction_ManageNotifications_Descr"
                LabelText="$Resources:BIMP, List_RibbonTabAction_ManageNotifications_Name"/>
            </Controls>
          </MenuSection>
        </CommandUIDefinition>
      </CommandUIDefinitions>

      <CommandUIHandlers>
        <CommandUIHandler
          Command="BIMP.Library.ManageNotificationsCommand"
          CommandAction="javascript:
              function DialogCallback(dialogResult, returnValue){
              }
              
              var options = { url:&quot;http://sharepoint-2:9999/_admin/BIMP/ManageNotifications.aspx?IsDlg=1&amp;SiteUrl={SiteUrl}&amp;ListID={ListId}&quot;,
                              width: 800,
                              height: 600,
                              allowMaximize: true,
                              showClose: true,
                              dialogReturnValueCallback: DialogCallback
                            };
              SP.UI.ModalDialog.showModalDialog(options);"
          />
        <CommandUIHandler
          Command="BIMP.Library.AddNewNotificationCommand"
          CommandAction="javascript:
              function DialogCallback(dialogResult, returnValue){
              }
              
              var options = { url:&quot;http://sharepoint-2:9999/_admin/BIMP/EditNotification.aspx?IsDlg=1&amp;SiteUrl={SiteUrl}&amp;ListID={ListId}&quot;,
                              width: 800,
                              height: 600,
                              allowMaximize: true,
                              showClose: true,
                              dialogReturnValueCallback: DialogCallback
                            };
              SP.UI.ModalDialog.showModalDialog(options);"
          />
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>

</Elements>

<!--Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction Id="MyCustomRibbonTab" Location="CommandUI.Ribbon.ListView" RegistrationId="101" RegistrationType="List">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.Tabs._children">
          <Tab Id="Ribbon.BIMP" Title="$Resources:BIMP, List_RibbonTab_Name" Description="$Resources:BIMP, List_RibbonTab_Descr" Sequence="501">
            <Scaling Id="Ribbon.BIMP.Scaling">
              <MaxSize Id="Ribbon.BIMP.MaxSize" GroupId="Ribbon.BIMP.NotificationMgmntGrp" Size="TwoLargeTwoMedium"/>
              <Scale Id="Ribbon.BIMP.Scaling.CustomTabScaling" GroupId="Ribbon.BIMP.NotificationMgmntGrp" Size="TwoLargeTwoMedium" />
            </Scaling>
            <Groups Id="Ribbon.BIMP.Groups">
              <Group
                Id="Ribbon.BIMP.NotificationMgmntGrp"
                Description="$Resources:BIMP, List_RibbonTabGroup_NotificationMgmnt_Descr"
                Title="$Resources:BIMP, List_RibbonTabGroup_NotificationMgmnt_Name"
                Sequence="52"
                Template="Ribbon.Templates.BIMP">
                <Controls Id="Ribbon.BIMP.NotificationMgmntGrp.Controls">
                  <Button 
                    Id="Ribbon.BIMP.NotificationMgmntGrp.Manage"
                    Command="BIMP.ManageNotificationsCommand"
                    Sequence="15"
                    Image32by32="/_layouts/images/BIMP/ManageNotifications_32x32.png"
                    Description="$Resources:BIMP, List_RibbonTabAction_ManageNotifications_Descr"
                    LabelText="$Resources:BIMP, List_RibbonTabAction_ManageNotifications_Name"
                    TemplateAlias="FirstLarge"/>
                  <Button
                    Id="Ribbon.BIMP.NotificationMgmntGrp.Request"
                    Command="BIMP.RequestNotificationCommand"
                    Sequence="17"
                    Image32by32="/_layouts/images/BIMP/RequestNotification_32x32.png"
                    Description="$Resources:BIMP, List_RibbonTabAction_RequestNotification_Descr"
                    LabelText="$Resources:BIMP, List_RibbonTabAction_RequestNotification_Name"
                    TemplateAlias="SecondLarge"/>
                  <Button
                    Id="Ribbon.BIMP.NotificationMgmntGrp.AddNew"
                    Command="BIMP.AddNewNotificationCommand"
                    Sequence="19"
                    Image16by16="/_layouts/images/BIMP/AddNewNotification_16x16.png"
                    Description="$Resources:BIMP, List_RibbonTabAction_AddNewNotification_Descr"
                    LabelText="$Resources:BIMP, List_RibbonTabAction_AddNewNotification_Name"
                    TemplateAlias="FirstMedium"/>
                  <Button
                    Id="Ribbon.BIMP.NotificationMgmntGrp.Request"
                    Command="BIMP.RequestNotificationCommand"
                    Sequence="21"
                    Image16by16="/_layouts/images/BIMP/RequestNotification_16x16.png"
                    Description="$Resources:BIMP, List_RibbonTabAction_RequestNotification_Descr"
                    LabelText="$Resources:BIMP, List_RibbonTabAction_RequestNotification_Name"
                    TemplateAlias="SecondMedium"/>
                </Controls>
              </Group>
            </Groups>
          </Tab>
        </CommandUIDefinition>
        <CommandUIDefinition Location="Ribbon.Templates._children">
          <GroupTemplate Id="Ribbon.Templates.BIMP">
            <Layout Title="TwoLargeTwoMedium" LayoutTitle="TwoLargeTwoMedium">
              <Section Alignment="Top" Type="OneRow">
                <Row>
                  <ControlRef DisplayMode="Large" TemplateAlias="FirstLarge" />
                </Row>
              </Section>
              <Section Alignment="Top" Type="OneRow">
                <Row>
                  <ControlRef DisplayMode="Large" TemplateAlias="SecondLarge" />
                </Row>
              </Section>
              <Section Alignment="Top" Type="TwoRow">
                <Row>
                  <ControlRef DisplayMode="Medium" TemplateAlias="FirstMedium" />
                </Row>
                <Row>
                  <ControlRef DisplayMode="Medium" TemplateAlias="SecondMedium" />
                </Row>
              </Section>
            </Layout>
          </GroupTemplate>
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler
          Command="BIMP.ManageNotificationsCommand"
          CommandAction="javascript:
              function DialogCallback(dialogResult, returnValue){
              }
              
              var options = { url:&quot;http://sharepoint-2:9999/_admin/BIMP/ManageNotifications.aspx?IsDlg=1&amp;SiteUrl={SiteUrl}&amp;ListID={ListId}&quot;,
                              width: 800,
                              height: 600,
                              allowMaximize: false,
                              showClose: true,
                              dialogReturnValueCallback: DialogCallback
                            };
              SP.UI.ModalDialog.showModalDialog(options);"
          />
        <CommandUIHandler
          Command="BIMP.AddNewNotificationCommand"
          CommandAction="javascript:
              function DialogCallback(dialogResult, returnValue){
              }
              
              var options = { url:&quot;http://sharepoint-2:9999/_admin/BIMP/EditNotification.aspx?IsDlg=1&amp;SiteUrl={SiteUrl}&amp;ListID={ListId}&quot;,
                              width: 800,
                              height: 600,
                              allowMaximize: false,
                              showClose: true,
                              dialogReturnValueCallback: DialogCallback
                            };
              SP.UI.ModalDialog.showModalDialog(options);"
          />
        <CommandUIHandler
          Command="BIMP.RequestNotificationCommand"
          CommandAction="javascript:alert('Сделай мне Нотификацию БЛЕАТЬ !');" />
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>
</Elements-->
